|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
A16450 (R) Universal Asynchronous Receiver/Transmitter Data Sheet September 1996, ver. 1 Features s s s s s s s s s A16450 MegaCore function implementing a universal asynchronous receiver/transmitter (UART) Optimized for FLEX(R) and MAX(R) architectures Programmable word length, stop bits, and parity Full duplex operation Programmable baud rate generator Prioritized interrupt control Internal diagnostic/loopback capabilities Uses approximately 372 FLEX logic elements (LEs) Functionally based on the National Semiconductor Corporation NS16450 device, except as noted in "Variations & Clarifications" on page 79 General Description The A16450 MegaCore function implements a universal asynchronous receiver/transmitter (UART), which provides an interface between a microprocessor and a serial communications channel. The A16450 receives and transmits data in a variety of configurations, including 5-, 6-, 7-, or 8-bit data words; odd, even, or no parity; and 1, 1.5, or 2 stop bits. The A16450 includes an internal baud rate generator and interrupt control. See Figure 1. Figure 1. A16450 Symbol A16450 nADS CLK CS0 CS1 nCS2 nBAUDOUT nCTS CSOUT nDCD DDIS nDSR nDTR MR INTR RCLK nOUT1 RD nOUT2 nRD nRTS nRI SOUT SIN DOUT[7..0] WR nWR A[2..0] DIN[7..0] Altera Corporation A-DS-A16450-01 65 A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 1 describes the input and output ports of the A16450. Table 1. A16450 Ports (Part 1 of 2) Name nads Type Input Polarity Low Description Address strobe. Enable signal to the address input receiver. The positive edge of nads latches the register address bus into the address input register. Clock. Provides the master timing reference to the A16450. Chip select 0. The A16450 is selected when cs0, cs1, and ncs2 are asserted, which permits read and write transactions to internal registers. Chip select 1. The A16450 is selected when cs0, cs1, and ncs2 are asserted, which permits read and write transactions to internal registers. Chip select 2. The A16450 is selected when cs0, cs1, and ncs2 are asserted, which permits read and write transactions to internal registers. Clear to send. Indicates that the modem is ready to exchange data. A change in input state from low to high is recorded in bit 0 of the modem status register. If the modem status interrupt is enabled when ncts changes state, an interrupt is generated. This input's complement is recorded in bit 4 of the modem status register. Data carrier detect. Indicates that the modem or data set detected a data carrier. A change in input state is recorded in bit 3 of the modem status register. If the modem status interrupt is enabled when ndcd changes state, an interrupt is generated. This input's complement is recorded in bit 7 of the modem status register. Data set ready. Indicates that the modem or data set is ready to establish the communications link with the A16450. A change in input state is recorded in bit 1 of the modem status register. If the modem status interrupt is enabled when ndsr changes state, an interrupt is generated. This input's complement is recorded in bit 5 of the modem status register. Master reset. Clears all registers (except the receiver buffer, transmitter holding, and divisor registers) to their initial state. Resets control logic to initial state. Receiver clock. Operates at 16 times the baud rate clock. Read control. When rd or nrd is asserted and the A16450 is selected, read transactions from internal registers are possible. Read control. When rd or nrd is asserted and the A16450 is selected, read transactions from internal registers are possible. Ring indicator. Indicates that the modem or data set detected the ring signal. A change in input state is recorded in bit 2 of the modem status register. If the modem status interrupt is enabled when nri changes state, an interrupt is generated. This input's complement is recorded in bit 6 of the modem status register. clk cs0 cs1 ncs2 ncts Input Input Input Input Input - High High Low Low ndcd Input Low ndsr Input Low mr Input High rclk rd nrd nri Input Input Input Input - High Low Low 66 Altera Corporation A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 1. A16450 Ports (Part 2 of 2) Name sin wr nwr a[2..0] din[7..0] nbaudout csout ddis Type Input Input Input Input Input Output Output Output Polarity - High Low - - Low High High Description Serial data input. Receives data for the A16450. Write control. When wr or nwr is asserted and the A16450 is selected, write transactions to internal registers are possible. Write control. When wr or nwr is asserted and the A16450 is selected, write transactions to internal registers are possible. Register address bus. Selects one of the internal registers. See Table 2. Data input bus. The microprocessor writes to internal registers via the din[7..0] bus. Baud out. Transmitter clock that is controlled by the programmable baud rate generator. Operates at 16 times the baud rate clock. Chip select output. Indicates that the A16450 has been selected (i.e., the cs0, cs1 and ncs2 inputs are asserted). Driver disable. Indicates that the microprocessor is reading data from the A16450. This output is intended as a disable or direction control between the A16450 and the microprocessor. Data terminal ready. Indicates that the A16450 is ready to exchange data. This output is controlled by writing to bit 0 of the modem control register. Interrupt. Indicates that an enabled interrupt condition has been met. User-programmable output 1. This output is controlled by writing to bit 2 of the modem control register. User-programmable output 2. This output is controlled by writing to bit 3 of the modem control register. Request to send. Indicates that the A16450 is ready to exchange data. This output is controlled by writing to bit 1 of the modem control register. Serial data out. Serial (transmitter) data out. When mr is asserted, the sout output is asserted. Data output bus. ndtr intr nout1 nout2 nrts sout dout[7..0] Output Output Output Output Output Output Output Low High Low Low Low High - Altera Corporation 67 A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Functional Description Figure 2 shows the A16450 block diagram. Figure 2. A16450 Block Diagram sin rclk din[7..0] a[2..0] cs0 cs1 ncs2 nads mr rd nrd wr nwr ddis csout Receiver Buffer Register Decode & Control Logic Line Control Register Output Data Multiplexer dout[7..0] Receiver Register & Control Divisor Register (MSB) Divisor Register (LSB) Baud Generator nbaudout clk Line Status Register Transmitter Register & Control sout Transmitter Holding Register nrts ndtr nout1 nout2 ncts ndsr ndcd nri Modem Control Register Modem Control Logic Modem Status Register Interrupt Enable Register Interrupt ID Register Interrupt Control Logic intr 68 Altera Corporation A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Register Address Map The state of the a[2..0] inputs determines which internal register the microprocessor addresses. See Table 2. The divisor register access bit (drab) allows access to the divisor register. The drab is bit 7 of the line control register. Table 2. Register Address Map drab (1) 0 1 0 1 X X X X X X Note: (1) The X indicates "don't care." a2 0 0 0 0 0 0 1 1 1 1 a1 0 0 0 0 1 1 0 0 1 1 a0 0 0 1 1 0 1 0 1 0 1 Register Receiver buffer register--read only Transmitter holding register--write only Divisor register (LSB) Interrupt enable register Divisor register (MSB) Interrupt ID register Line control register Modem control register Line status register Modem status register Scratchpad register Registers The A16450 MegaCore function contains the following registers: s s s s s s s s s s Receiver buffer Transmitter holding Divisor Interrupt enable Interrupt identification Line control Modem control Line status Modem status Scratchpad Altera Corporation 69 A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Receiver Buffer Register The receiver buffer register is a read-only register that contains the last complete data word sample received by the A16450. Transmitter Holding Register The transmitter holding register is a write-only register that loads the next data byte to be transmitted by the A16450. Divisor Register The divisor register controls the programmable baud rate generator. The 16-bit divisor performs an integer frequency divide of the input clock. The nbaudout output becomes the transmitter clock that operates at 16 times the baud rate clock. For example, if the input clock is 10 MHz and the divisor register is set to a binary 2 (0000000000000010), the nbaudout will be a 5-MHz output with a 50/50 duty cycle. The effective baud rate will be 1/16th of 5 MHz, or 312,500 baud. In addition, the nbaudout output may be wrapped to the receiver section input clock (rclk) to provide the receiver clock that operates at 16 times the baud rate clock. The A16450 does not support a divide-by-0 operation, which produces the same results as a divide-by-1 operation for the nbaudout output. However, a divide-by-0 operation prevents the transmitter from functioning because an internal signal, baud_en, is not generated. The baud_en signal enables the clock in the transmitter. Interrupt Enable Register The A16450 supports interrupts from four different sources; the interrupt enable register selectively enables or disables interrupts from each of these sources. When a bit is reset to a logic low, the A16450 will not recognize interrupts from that source. Table 3 shows the interrupt enable register format. 70 Altera Corporation A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 3. Interrupt Enable Register Format Bit 0 Signal rda Description Received data available. When set to a logic high, bit 0 enables interrupts when receive data is loaded in the receiver buffer register. 1 2 3 7..4 thre Transmitter holding register empty. When set to a logic high, bit 1 enables interrupts when the transmitter holding register is empty. rls ms - Receiver line status. When set to a logic high, bit 2 enables interrupts when the receiver line status register changes state. Modem status. When set to a logic high, bit 3 enables interrupts when the modem status register changes state. Read-only bits that are always set to a logic low. Interrupt Identification Register The A16450 has a priority encoding scheme for its four interrupt sources. Table 4 shows the encoding scheme for each of the interrupts, their priority, and the reset mechanism for each interrupt source. When set to a logic low, bit 0 indicates that an interrupt is pending. Bits 1 and 2 indicate the interrupt priority, and bits 3 through 7 are read-only bits that are always set to a logic low. Clearing an interrupt source does not affect any lower priority interrupts that might be pending. When the interrupt identification register is accessed, the highest priority interrupt at the beginning of the access is recorded in the register. Other interrupts, including those of higher priority, are recorded but are not recognized until the current register access is complete. Altera Corporation 71 A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 4. Interrupt Identification Register Format Bit 0 1 0 Note (1) Interrupt Source - Bit 1 X 1 Bit 2 X 1 Bits 7..3 0 0 Interrupt Type No interrupt Receiver line status Receiver data available Transmitter holding register empty Modem status Reset Mechanism - Priority - Overrun, parity, or Read the receiver line Highest framing errors; break status register interrupt Receiver data available Transmitter holding register empty Read the receiver buffer Read the interrupt ID register or write to the transmitter holding register 2 3 0 0 0 1 1 0 0 0 0 0 0 0 cts, dsr, ri, or dcd Read the modem change state status register 4 Note: (1) The X indicates "don't care." Line Control Register The line control register sets the data and communication formats used by the A16450. See Table 5. 72 Altera Corporation A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 5. Line Control Register Format Bit 1..0 2 3 Description Word length control. Sets the length of the word associated with each transmitted or received word. See Table 6. Stop control bit. Controls the number of stop bits generated by the transmitter section. The receiver circuitry checks for the first stop bit only, regardless of the state of bit 2. See Table 7. Parity enable. When set to a logic high, parity generation in the transmitter section and parity checking in the receiver section are enabled. The parity bit is inserted between the last word bit and the first stop bit. Parity even/odd. When set to a logic high, even parity is enabled; when set to a logic low, odd parity is enabled. Stick parity. Forces the parity bit to a known value. If parity is enabled and even parity is selected, the transmitter section will transmit the parity bit as a logic low. Then, the receiver section checks that the incoming parity bit is set to logic low. Break control. When set, bit 6 forces the A16450 to transmit a break condition. The sout output is forced to a logic low state for longer than one full word transmission. Disable the break by clearing bit 6, which causes sout to return to a logic high. The sout output is set to a logic high upon master reset. Divisor register access bit (drab). This bit must be set high to access the divisor registers. A low enables access to the receiver buffer and transmitter holding registers. 4 5 6 7 Table 6 lists the word length associated with bits 0 and 1. Table 6. Word Length Control Format Bit 0 0 1 0 1 Bit 1 0 0 1 1 Word Length 5 bits 6 bits 7 bits 8 bits Altera Corporation 73 A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 7 lists the number of stop bits and word length associated with bit 2. Table 7. Stop Bit Control Format Bit 2 0 1 1 1 1 Note: (1) The X indicates "don't care." Word Length Note (1) X 5 bits 6 bits 7 bits 8 bits Number of Stop Bits 1 1.5 2 2 2 Modem Control Register The modem control register controls the modem interface outputs. Table 8 describes the modem control register format. Table 8. Modem Control Register Format Bit 0 1 2 3 4 Signal dtr rts out1 out2 el Description Data terminal ready. The user can program the dtr bit to control the ndtr output. Request to send. The user can program the rts bit to control the nrts output. Output 1. The user can program the out1 bit to control the nout1 output. Output 2. The user can program the out2 bit to control the nout2 output. Enable loopback. When high, bit 4 causes the following: s The sout output is set to a logic high. s The sin input is disconnected (i.e., ignored). s The output of the transmitter shift register is internally connected (loopbacked) to the receiver shift register input. s The modem control inputs are disconnected (i.e., ignored). s The modem control outputs are used internally in place of the modem control inputs. Not used. These read-only bits are always set to a logic low. 7..5 - Line Status Register The line status register enables the host processor to examine data transfers. Table 9 describes the line status register format. 74 Altera Corporation A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 9. Line Status Register Format Bit 0 Signal rdr Description Receiver data ready. Indicates that an incoming word has been received and transferred to the receiver buffer register. When bit 0 is set to a logic high, a receive data available interrupt is generated. Bit 0 is cleared by reading the receiver buffer register. Overrun error. Indicates that new data wrote over unread data in the receiver buffer register. When bit 1 is set to a logic high, a receiver line status interrupt is generated. Bit 1 is cleared by reading the line status register. Parity error. Indicates that newly received data had incorrect parity. When bit 2 is set to a logic high, a receiver line status interrupt is generated. Bit 2 is cleared by reading the line status register. Framing error. Indicates that newly received data had an invalid stop bit. When bit 3 is set to a logic high, a receiver line status interrupt is generated. Bit 2 is cleared by reading the line status register. Break interrupt. Indicates that a break condition was detected on the serial input. A break condition occurs when the serial data in (sin) is held at logic low for longer than one full word transmission. When bit 4 is set to a logic high, a receiver line status interrupt is generated. Bit 4 is cleared by reading the line status register. 1 oe 2 pe 3 fe 4 bi 5 thre Transmitter holding register empty. Indicates that the A16450 is ready to accept a new data word from the microprocessor for transmission. When bit 5 is set to a logic high, a transmitter holding register empty interrupt is generated. Bit 5 is cleared by reading the interrupt ID register or by writing to the transmitter holding register. tre - Transmitter empty. Indicates that the transmitter holding register and the transmitter shift register are both empty. Not used. This read-only bit is always set to a logic low. 6 7 Modem Status Register The modem status register enables the microprocessr to examine the condition of the modem interface inputs. Table 10 shows the modem status register format. Altera Corporation 75 A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Table 10. Modem Status Register Format Bit 0 Signal dcts Description Delta clear to send. Indicates that the ncts input has changed state since the processor last read the modem status register. When bit 0 is set to a logic high, a modem status interrupt is generated. Delta data set ready. Indicates that the ndsr input has changed since the processor last read the modem status register. When bit 1 is set to a logic high, a modem status interrupt is generated. Trailing edge ring indicator. Indicates that a trailing (0 to 1) edge has occurred on the nri input since the processor last read the modem status register. When bit 2 is set to a logic high, a modem status interrupt is generated. Delta data carrier detect. Indicates that the ndcd input has changed state since the processor last read the modem status register. When bit 3 is set to a logic high, a modem status interrupt is generated. Clear to send. This bit is the complement of the ncts input. Data set ready. This bit is the complement of the ndsr input. Ring indicator. This bit is the complement of the nri input. Data carrier detect. This bit is the complement of the ndcd input. 1 ddsr 2 teri 3 ddcd 4 5 6 7 cts dsr ri dcd Scratchpad Register The scratchpad register is a general-purpose register provided for the convenience of the user. 76 Altera Corporation A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Timing Waveforms Figure 3 shows the read and write cycle waveforms for the A16450 megafunction. Figure 3. Read & Write Cycle Waveforms Write Cycle clk nads a[2..0] ncs2, cs1, cs0 csout nwr, wr din[7..0] Active Valid Valid Valid Read Cycle clk nads a[2..0] ncs2, cs1, cs0 csout nrd, rd ddis dout[7..0] Valid Active Valid Valid Figure 4 shows the functional timing waveforms for the A16450. Altera Corporation 77 A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Figure 4. A16450 Functional Timing Waveforms Baudout Timing clk nbaudout (divide-by-1) nbaudout (divide-by-2) nbaudout (divide-by-3) nbaudout (divide-by-n) 2 clk cycles (n-2) clk cycles Receiver Timing sin Sample clk intr (data ready or receiver error) nrd, rd Active Start Parity Stop Transmitter Timing sout thre nwr, wr nrd, rd Start Data (5-8) Parity Stop (1-2) Start Modem Control Timing nwr, wr rts, dtr, out1, out2 cts, dsr, dcd intr nrd, rd ri 78 Altera Corporation A16450 Universal Asynchronous Receiver/Transmitter Data Sheet Variations & Clarifications The A16450 differs from the National NS16450 device in the following ways: s s s The bidirectional bus d[7..0] in the NS16450 is split into an input bus din[7..0] and an output bus dout[7..0] in the A16450. The dout[7..0] bus is the direct output of the output data multiplexer, and is not tri-stated or otherwise affected by the rd or nrd inputs. In the A16450 megafunction, the address registers are implemented as registers, as opposed to latches in the NS16450 device. These registers use clk as the clock source and nads as a clock enable. The A16450 megafunction uses a single clk input as the primary clock source. The NS16450 device uses the crystal oscillator interface (xin input and xout output) as the primary clock source. Altera Corporation 79 Copyright (c) 1995, 1996, 1997, 1998 Altera Corporation, 101 Innovation Drive, San Jose, CA 95134, USA, all rights reserved. By accessing this information, you agree to be bound by the terms of Altera's Legal Notice. |
Price & Availability of A16450 |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |